#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int bin_search0(int arr[5][5], int left, int right, int key,int i)
{
	int mid;
	while (left <= right) {
		mid = (left + right) / 2;
		if (arr[mid][i] > key)right = mid - 1;
		else if (arr[mid][i] < key)left = mid + 1;
		else if (arr[mid][i] == key)return mid;
	}
	return -1;
}
int bin_search1(int* arr, int left, int right, int key)
{
	int mid;
	while (left <= right) {
		mid = (left + right) / 2;
		if (arr[mid] > key)right = mid - 1;
		else if (arr[mid] < key)left = mid + 1;
		else if (arr[mid] == key)return mid;
	}
	return left;
}
int main()
{
	int arr[5][5] = { {1,2,3,4,5},{2,3,4,5,6},{3,4,5,6,7},{4,5,6,7,8},{5,6,7,8,9} };
	int sz = sizeof(arr[0]) / sizeof(arr[0][0]);
	int key;
	scanf("%d", &key);
	int i = bin_search1(arr[0], 0, sz, key);
	int sz0 = sizeof(arr) / sizeof(arr[0]);
	int result = -1;
	for (; i >= 0; i--) {
		result = bin_search0(arr, 0, sz0, key, i);
		if (result > 0)break;
	}
	if (result > 0)printf("Y");
	else printf("N");
	return 0;
}